package com.tencent.compose.sample.mainpage.material3

import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import org.jetbrains.compose.ui.tooling.preview.Preview


@Preview()
@Composable
internal fun TextButtonDemo() {
    // 用于记录点击次数的状态变量（会触发UI重组）
    var clickCount by remember { mutableStateOf(0) }
    TextButton(
        onClick = {
            clickCount++
        }
    ) {
        Text("点击我 ($clickCount)")
    }
}